<?php
$title = elgg_echo ( 'submana:listsubject' ) . ' của giảng viên ' . elgg_get_logged_in_user_entity()->name;
$content = elgg_view_title ( $title );

$metadata_options = array (
		array (
				'name' => 'grouptype',
				'value' => SUBJECT_GROUP 
		) 
);
$user = elgg_get_logged_in_user_entity();

$teacher = get_user_by_username($vars['teacher']);

$options = array (
		'type' => "group",
		'owner_guid' => $teacher->guid,
		'metadata_name_value_pairs' => $metadata_options, 
		'full_view' => false,
);

$projectlistview = elgg_list_entities_from_metadata($options);
$content .= $projectlistview;
$create_new_subject = elgg_view('output/url', array(
	'text' => "Môn học mới",
	'href' => "groups/addgroupsubject/".elgg_get_logged_in_user_guid(),
	'class' => "elgg-button"
));
$content.= $create_new_subject;

$sidebar = "";
$params = array (
		'content' => $content,
		'sidebar' => $sidebar 
);

$body = elgg_view_layout ( 'one_sidebar', $params );
// start building the main column of the page

echo elgg_view_page ( $title, $body );